import request from '@/utils/request'
import { kfApiUrl, appApiUrl, commonApiUrl, projectApiUrl } from '../config'

/**
 * 看板
 */
 export function querySafetyProcessById(params) {
  return request({
    url: `${kfApiUrl}/customerComplaint/querySafetyProcessById`,
    method: 'get',
    params
  })
}
 export function queryStatisticsCost(data) {
  return request({
    url: `${kfApiUrl}/Statistics/queryStatisticsCost`,
    method: 'post',
    data
  })
}
 export function complaintLevelAnalysis(params) {
  return request({
    url: `${kfApiUrl}/Statistics/complaintLevelAnalysis`,
    method: 'get',
    params
  })
}
export function complaintConstructionStageAnalysis(params) {
  return request({
    url: `${kfApiUrl}/Statistics/complaintConstructionStageAnalysis`,
    method: 'get',
    params
  })
}
 export function complaintFormatsAnalysis(params) {
  return request({
    url: `${kfApiUrl}/Statistics/complaintFormatsAnalysis`,
    method: 'get',
    params
  })
}
 export function complaintHandleAnalysis(params) {
  return request({
    url: `${kfApiUrl}/Statistics/complaintHandleAnalysis`,
    method: 'get',
    params
  })
}
 export function complaintTimeAnalysis(params) {
  return request({
    url: `${kfApiUrl}/Statistics/complaintTimeAnalysis`,
    method: 'get',
    params
  })
}
 export function FinishProportion(params) {
  return request({
    url: `${kfApiUrl}/Statistics/maintenanceFinishProportion`,
    method: 'get',
    params
  })
}
 export function maintenanceAvgScore(params) {
  return request({
    url: `${kfApiUrl}/Statistics/maintenanceAvgScore`,
    method: 'get',
    params
  })
}
 export function HandleProportion(params) {
  return request({
    url: `${kfApiUrl}/Statistics/maintenanceHandleProportion`,
    method: 'get',
    params
  })
}
 export function getMaintenanceNum(params) {
  return request({
    url: `${kfApiUrl}/Statistics/getMaintenanceNum`,
    method: 'get',
    params
  })
}

export function SatisfactionTrendStatistics(params) {
  return request({
    url: `${kfApiUrl}/Statistics/SatisfactionTrendStatistics`,
    method: 'get',
    params
  })
}

export function customerSatisfactionComplaint(params) {
  return request({
    url: `${kfApiUrl}/Statistics/customerSatisfactionComplaint`,
    method: 'get',
    params
  })
}

export function monthlyComplaint(params) {
  return request({
    url: `${kfApiUrl}/Statistics/monthlyComplaint`,
    method: 'get',
    params
  })
}
export function complaintProportion(params) {
  return request({
    url: `${kfApiUrl}/Statistics/complaintProportion`,
    method: 'get',
    params
  })
}
export function complaintHandleProportion(params) {
  return request({
    url: `${kfApiUrl}/Statistics/complaintHandleProportion`,
    method: 'get',
    params
  })
}
//统计表扬信概况
export function countPraiseOverview(params) {
  return request({
    url: `${kfApiUrl}/customerPraise/countPraiseOverview`,
    method: 'get',
    params
  })
}
//统计分公司表扬信数量
export function countPraiseNum(params) {
  return request({
    url: `${kfApiUrl}/customerPraise/countPraiseNum`,
    method: 'get',
    params
  })
}


/**
 * @description 获取编码
 */
 export function getSubContractorList(params) {
  return request({
    url: `${kfApiUrl}/customerComplaint/getSubContractorList`,
    method: 'get',
    params
  })
}
/**
 * @description 获取编码
 */
 export function updateByPrimaryKeySelective(data) {
  return request({
    url: `${kfApiUrl}/customerComplaintInfo/updateByPrimaryKeySelective`,
    method: 'post',
    data
  })
}
/**
 * @description 获取编码
 */
 export function getPageCustomerComplaintInfo(data) {
  return request({
    url: `${kfApiUrl}/customerComplaintInfo/getPageCustomerComplaintInfo`,
    method: 'post',
    data
  })
}
/**
 * @description 获取编码
 */
 export function getAllBusinessCode(params) {
  return request({
    url: `${kfApiUrl}/customerComplaint/getAllBusinessCode`,
    method: 'get',
    params
  })
}
/**
 * @description 撤销
 */
 export function customerComplaintCancel(params) {
  return request({
    url: `${kfApiUrl}/customerComplaint/cancel`,
    method: 'get',
    params
  })
}
/**
 * @description 保存并提交
 */
 export function customerSubmit(data) {
  return request({
    url: `${kfApiUrl}/customerComplaint/submit`,
    method: 'post',
    data
  })
}
/**
 * @description 保存并提交
 */
 export function saveAndSubmit(data) {
  return request({
    url: `${kfApiUrl}/customerComplaint/saveAndSubmit`,
    method: 'post',
    data
  })
}
/**
 * @description 添加数据管理
 */
 export function getCustomerDataManagerById(params) {
  return request({
    url: `${kfApiUrl}/customerDataManager/getCustomerDataManagerById`,
    method: 'get',
    params
  })
}
/**
 * @description 添加数据管理
 */
 export function addCustomerDataManager(data) {
  return request({
    url: `${kfApiUrl}/customerDataManager/insertSelective`,
    method: 'post',
    data
  })
}
/**
 * @description 添加数据管理
 */
 export function editCustomerDataManager(data) {
  return request({
    url: `${kfApiUrl}/customerDataManager/updateByPrimaryKeySelective`,
    method: 'post',
    data
  })
}
/**
 * @description 数据管理
 */
 export function getCustomerList(data) {
  return request({
    url: `${kfApiUrl}/customerDataManager/queryCustomerDataManagerList`,
    method: 'post',
    data
  })
}


/**
 * @description 修改投诉事项信息
 */
 export function changeCustomerComplaint(data) {
  return request({
    url: `${kfApiUrl}/customerComplaint/updateByPrimaryKeySelective`,
    method: 'post',
    data
  })
}
/**
 * @description 查看投诉信息
 */
 export function getBusinessCode(params) {
  return request({
    url: `${kfApiUrl}/customerComplaint/getBusinessCode`,
    method: 'get',
    params
  })
}

/**
 * @description 查看投诉信息
 */
 export function getCustomerComplaintById(params) {
  return request({
    url: `${kfApiUrl}/customerComplaint/getCustomerComplaintById/${params}`,
    method: 'get'
  })
}


/**
 * @description 投诉事项信息
 */
 export function getComplaintTree(data) {
  return request({
    url: `${kfApiUrl}/customerComplaintInfo/queryCustomerComplaintInfoList`,
    method: 'post',
    data
  })
}
/**
 * @description 投诉类型信息
 */
 export function getComplaintType(params) {
  return request({
    url: `${kfApiUrl}/customerComplaint/getComplaintType`,
    method: 'get',
    params
  })
}
/**
 * @description 投诉人信息
 */
 export function getOwnerInfoList(params) {
  return request({
    url: `${kfApiUrl}/customerComplaint/getOwnerInfoList/${params}`,
    method: 'get'
  })
}
/**
 * @description 项目信息
 */
 export function getProjectInfo(params) {
  return request({
    url: `${kfApiUrl}/customerComplaint/getProjectInfo/${params}`,
    method: 'get'
  })
}
/**
 * @description 项目列表
 */
 export function getPCProjectList(data) {
  return request({
    url: `${kfApiUrl}/customerComplaint/getPCProjectList`,
    method: 'post',
    data
  })
}
/**
 * @description 投诉列表
 */
 export function addCustomerComplaint(data) {
  return request({
    url: `${kfApiUrl}/customerComplaint/insertSelective`,
    method: 'post',
    data
  })
}

/**
 * @description 投诉分类
 */
 export function queryComplaintTree(params) {
  return request({
    url: `${kfApiUrl}/customerComplaintTree/queryComplaintTree`,
    method: 'get',
    params
  })
}
/**
 * @description 投诉列表
 */
 export function exportComplaint(data) {
  return request({
    url: `${kfApiUrl}/customerComplaint/exportComplaint`,
    method: 'post',
    data
  })
}

/**
 * @description 投诉列表
 */
 export function getComplaintList(data) {
  return request({
    url: `${kfApiUrl}/customerComplaint/getPageCustomerComplaint`,
    method: 'post',
    data
  })
}

/**
 * @description 获取整改人
 */
export function getProblemEmployees(params) {
  return request({
    url: `/ycloud-organization/employees/list-by`,
    method: 'get',
    params
  })
}

/**
 * @description 获取责任人
 */
export function getProblemNode(params) {
  return request({
    url: `${appApiUrl}/problem/getNodeStatusById`,
    method: 'get',
    params
  })
}

/**
 * @description 获取复查人
 */
export function getProblemEmp(params) {
  return request({
    url: `${appApiUrl}/problem/employees`,
    method: 'get',
    params
  })
}


/**
 * @description 问题具体位置
 */
 export function getNodeById(id) {
  return request({
    url: `${appApiUrl}/problem/getNodeById/${id}`,
    method: 'get',
  })
}
/**
 * @description 排查隐患
 */
export function getLabelTypesLeft(params) {
  return request({
    url: `${appApiUrl}/safety/getLabelTypesLeft/HIDDEN_DANGERS_LEFT`,
    method: 'get',
    params
  })
}

/**
 * @description 获取问题级别
 */
export function getProblem(data) {
  return request({
    url: `${appApiUrl}/problem/type`,
    method: 'post',
    data
  })
}

/**
 * @description 获取BIM构建
 */
export function getBimResult(params) {
  return request({
    url: `${commonApiUrl}/bidding-model/list`,
    method: 'get',
    params
  })
}

/**
 * @description 责任分包
 */
 export function getEntryLedger(params) {
  return request({
    url: `${projectApiUrl}/entry-exit-ledger/list`,
    method: 'get',
    params
  })
}

